import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '任务书ID',
    align:"center",
    dataIndex: 'wmTaskbookId'
   },
   {
    title: '物料名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '物料编码',
    align:"center",
    dataIndex: 'code'
   },
   {
    title: '物料需求数量',
    align:"center",
    dataIndex: 'needNum'
   },
   {
    title: '物料采购数量',
    align:"center",
    dataIndex: 'purchaseNum'
   },
   {
    title: '序号',
    align:"center",
    dataIndex: 'seriesNo'
   },
   {
    title: '采购开始时间',
    align:"center",
    dataIndex: 'purchaseTime'
   },
   {
    title: '物料到货时间',
    align:"center",
    dataIndex: 'arriveTime'
   },
   {
    title: '物料领取时间',
    align:"center",
    dataIndex: 'consumeTime'
   },
   {
    title: '收货人',
    align:"center",
    dataIndex: 'receiveBy'
   },
   {
    title: '发货人',
    align:"center",
    dataIndex: 'sendBy'
   },
   {
    title: '发货时间',
    align:"center",
    dataIndex: 'sendTime'
   },
   {
    title: '物流单号',
    align:"center",
    dataIndex: 'logisticsNo'
   },
   {
    title: '物流公司',
    align:"center",
    dataIndex: 'logisticsCompany'
   },
   {
    title: '发货目的地',
    align:"center",
    dataIndex: 'destination'
   },
   {
    title: '附件',
    align:"center",
    dataIndex: 'file',
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务书ID',
    field: 'wmTaskbookId',
    component: 'Input',
  },
  {
    label: '物料名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '物料编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '物料需求数量',
    field: 'needNum',
    component: 'Input',
  },
  {
    label: '物料采购数量',
    field: 'purchaseNum',
    component: 'Input',
  },
  {
    label: '序号',
    field: 'seriesNo',
    component: 'Input',
  },
  {
    label: '采购开始时间',
    field: 'purchaseTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物料到货时间',
    field: 'arriveTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物料领取时间',
    field: 'consumeTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '收货人',
    field: 'receiveBy',
    component: 'Input',
  },
  {
    label: '发货人',
    field: 'sendBy',
    component: 'Input',
  },
  {
    label: '发货时间',
    field: 'sendTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物流单号',
    field: 'logisticsNo',
    component: 'Input',
  },
  {
    label: '物流公司',
    field: 'logisticsCompany',
    component: 'Input',
  },
  {
    label: '发货目的地',
    field: 'destination',
    component: 'Input',
  },
  {
    label: '附件',
    field: 'file',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '状态',
    field: 'status',
    defaultValue: "PREPARE",
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  wmTaskbookId: {title: '任务书ID',order: 0,view: 'text', type: 'string',},
  name: {title: '物料名称',order: 1,view: 'text', type: 'string',},
  code: {title: '物料编码',order: 2,view: 'text', type: 'string',},
  needNum: {title: '物料需求数量',order: 3,view: 'text', type: 'string',},
  purchaseNum: {title: '物料采购数量',order: 4,view: 'text', type: 'string',},
  seriesNo: {title: '序号',order: 5,view: 'text', type: 'string',},
  purchaseTime: {title: '采购开始时间',order: 6,view: 'datetime', type: 'string',},
  arriveTime: {title: '物料到货时间',order: 7,view: 'datetime', type: 'string',},
  consumeTime: {title: '物料领取时间',order: 8,view: 'datetime', type: 'string',},
  receiveBy: {title: '收货人',order: 9,view: 'text', type: 'string',},
  sendBy: {title: '发货人',order: 10,view: 'text', type: 'string',},
  sendTime: {title: '发货时间',order: 11,view: 'datetime', type: 'string',},
  logisticsNo: {title: '物流单号',order: 12,view: 'text', type: 'string',},
  logisticsCompany: {title: '物流公司',order: 13,view: 'text', type: 'string',},
  destination: {title: '发货目的地',order: 14,view: 'text', type: 'string',},
  file: {title: '附件',order: 15,view: 'file', type: 'string',},
  status: {title: '状态',order: 16,view: 'text', type: 'string',},
  remark: {title: '备注',order: 17,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}